//用户相关接口统一管理
import request from "@/utils/request.ts";
import type {
  loginForm,
  loginResponseData,
  userInfoResponseData,
} from "./type.ts";

//真实的接口
//http://139.198.104.58:8212/swagger-ui.html#!/index45controller/loginUsingPOST 商品相关接口文档
//http://139.198.104.58:8209/swagger-ui.html#/ 用户相关接口文档
enum API {
  LOGIN_URL = "/admin/acl/index/login",
  USERINFO_URL = "/admin/acl/index/info",
  LOGOUT_URL = "/admin/acl/index/logout",
}

export const reqLogin = (data: loginForm) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data);

export const reqUserInfo = () =>
  request.get<any, userInfoResponseData>(API.USERINFO_URL);

export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL);
